#include <fstream>
#include <iostream>
using namespace std;

int main()
{
    string buffer;

    ifstream ifs("test.txt");
    ofstream ofs("test1.txt");
    ifs >> (string&)buffer;
    while( !ifs.eof())
    {
    	cout << buffer << endl;
        ofs << buffer << endl;
	ifs >> buffer;
    }
    return 0; 
}
